Skip to content

fmath.h: re-inline convert_type() half varieties#5130

Merged
lgritz merged 1 commit intoAcademySoftwareFoundation:mainfrom
lgritz:lg-fmath
Apr 18, 2026
Merged

fmath.h: re-inline convert_type() half varieties#5130
lgritz merged 1 commit intoAcademySoftwareFoundation:mainfrom
lgritz:lg-fmath

Conversation

@lgritz
Copy link
Copy Markdown
Collaborator

@lgritz lgritz commented Apr 4, 2026

A few years ago, in PR #3301, we made a big effort to remove Imath types as much as possible from the public APIs. Somehow, as part of that refactor, we ended up with just the half-varieties of fmath.h's convert_types() templates actually being implemented in fmath.cpp and only declared (by default) in fmath.h. I'm honestly not sure why I did that now, and the PR doesn't explain that particular point.

But that sets up a potential link incompatibility if OIIO used a different release of Imath than the use is using when calling that utility function.

So this PR makes it fully inline again, so the Imath version the downstream package uses just doesn't need to match what was found/used at the time that OIIO was built.

A few years ago, in PR 3301, we made a big effort to remove Imath
types as much as possible from the public APIs. Somehow, as part of
that refactor, we ended up with just the half-varieties of fmath.h's
convert_types() templates actually being implemented in fmath.cpp and
only declared (by default) in fmath.h. I'm honestly not sure why I did
that now, and the PR doesn't explain that particular point.

But that sets up a potential link incompatibility if OIIO used a
different release of Imath than the use is using when calling that
utility function.

So this PR makes it fully inline again, so the Imath version the
downstream package uses just doesn't need to match what was found/used
at the time that OIIO was build.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz
Copy link
Copy Markdown
Collaborator Author

lgritz commented Apr 11, 2026

Can anybody think of reason why this would be harmful?

@lgritz
Copy link
Copy Markdown
Collaborator Author

lgritz commented Apr 18, 2026

2 weeks old, no objections even after asking ==> merge

@lgritz lgritz merged commit 76451af into AcademySoftwareFoundation:main Apr 18, 2026
31 checks passed
@lgritz lgritz deleted the lg-fmath branch April 18, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant